<?php

namespace App\Http\Middleware;

use Closure;
use App\Admin\Member;
use Auth;

class CheckMember
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $role_id = Auth::guard('member') -> user() -> role_id;
        
        if ($role_id == '3') {
            die("你是顶级会员不需要升级");
        } 
        return $next($request);
    }
}
